package com.none.core.common.utils;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.support.RequestContextUtils;

import com.none.core.common.spring.SpringContext;

public class PropertyUtil {
	
	public static String getProperty(String key) {
		HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
		Locale locale = RequestContextUtils.getLocaleResolver(request).resolveLocale(request); 
		return SpringContext.getApplicationContext().getMessage(key, null, null, locale);  
	}

}
